package com.group5.baseline.user.pojo;

import java.util.Date;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 用户表(User)实体类
 *
 * @author makejava
 * @since 2021-06-22 09:14:03
 * @version 1.0
 */
@ApiModel(value = "User",description = "用户表")
public class User implements Serializable {
    private static final long serialVersionUID = 920523740127111263L;
    /**
    * 用户表主键id
    */
	@ApiModelProperty(name = "id",notes = "用户表主键id",dataType = "Integer",required = true)
    private Integer id;
    /**
    * 用户名称
    */
	@ApiModelProperty(name = "username",notes = "用户名称",dataType = "String",required = true)
    private String username;
    /**
    * 密码
    */
	@ApiModelProperty(name = "password",notes = "密码",dataType = "String",required = true)
    private String password;
    /**
    * 手机号
    */
	@ApiModelProperty(name = "phone",notes = "手机号",dataType = "String",required = true)
    private String phone;
    /**
    * 最后登录时间
    */
	@ApiModelProperty(name = "lastLoginTime",notes = "最后登录时间",dataType = "Date",required = true)
    //接收字符串日期，转换为Date对象，前端必须传递“2020-06-15 01:01:01”这样的格式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    // 下面是服务器响应返回的内容，如果没有格式化转换，那么返回的内容是长毫秒数，接受MySQL数据库中的数据也需要设置东八区+8时
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT + 8")
    private Date lastLoginTime;
    /**
    * 帐户创建时间
    */
	@ApiModelProperty(name = "createTime",notes = "帐户创建时间",dataType = "Date",required = true)
    //接收字符串日期，转换为Date对象，前端必须传递“2020-06-15 01:01:01”这样的格式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    // 下面是服务器响应返回的内容，如果没有格式化转换，那么返回的内容是长毫秒数，接受MySQL数据库中的数据也需要设置东八区+8时
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT + 8")
    private Date createTime;
    /**
    * 部门主键id
    */
	@ApiModelProperty(name = "departmentId",notes = "部门主键id",dataType = "Integer",required = true)
    private Integer departmentId;
    /**
    * 权限主键id
    */
	@ApiModelProperty(name = "roleId",notes = "权限主键id",dataType = "Integer",required = true)
    private Integer roleId;

	private Department department;
	private Role role;

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
        
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
        
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
        
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }
        
    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
        
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
        
    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }
        
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

}